import React from 'react' 
import Container from '@/components/Container'
import { RouterView, nameToPathConfig } from '@/router'
import './index.scss'
export default function Home() {
    const parent = 'routeNest'
    const hconfig = nameToPathConfig(parent)
    const navs = hconfig.child.map(({ link }, i) => <React.Fragment key={i}>{link}</React.Fragment>)
    return (
        <Container>
            <div className="route-container">
                home
                <div>
                    <h1>路由嵌套</h1>
                    <nav>
                        {navs}
                    </nav>
                    <div>
                        <RouterView parent={parent} />
                    </div>
                </div>
            </div>
        </Container>
    )
}
